<?php
namespace Bundle\ModuleBundle\DataSource;

class TextDataSource implements \Bundle\ModuleBundle\Interfaces\DataSourceInterface
{
    private $_source;
    private $_field;
    public function __construct($config)
    {
        $this->_source = $config['entity'];
        $this->_field = $config['field'];
    }

    public function getText()
    {
        $method = 'get' . ucfirst ($this->_field);
        return $this->_source->$method();
    }
}